/**
 * Description:
 * Class Name:Apple
 * Date:2022/3/25 12:56
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第9章_泛型._9_3_类型通配符._9_3_4_设定泛型形参的上限;

public class Apple<T extends Number> {
    T col;

    public static void main(String[] args) {
        Apple<Integer> ai = new Apple<>();
        Apple<Double> ad = new Apple<>();
        // 下面的代码将引起异常：试图将String类型传给T形参
        // 但String不是Number的子类型，所以引起编译错误
//        Apple<String> as = new Apple<>();
    }
}
